home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tool-inc.zip / ERRMSG.INC < prev    next >
Text File  |  1989-07-12  |  2KB  |  80 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * return error message based on tpas 4.0 runtime error codes
  15.  * s.h.smith, 5-jan-88 (6-jan-88)
  16.  *
  17.  *)
  18. function errormsg(code: integer): string;
  19. var
  20.    class:  string;
  21.    msg:    string;
  22. begin
  23.    case code of
  24.         1..99:  class := 'DOS';
  25.       100..149: class := 'I/O';
  26.       150..199: class := 'CRITICAL';
  27.       200..249: class := 'FATAL';
  28.       else      class := 'UNKNOWN';
  29.    end;
  30.  
  31.    case code of
  32.         2: msg := 'File not found';
  33.         3: msg := 'Path not found';
  34.         4: msg := 'Too many open files';
  35.         5: msg := 'File access denied';
  36.         6: msg := 'Bad file handle';
  37.        12: msg := 'Bad file access code';
  38.        15: msg := 'Bad drive number';
  39.        16: msg := 'Can''t remove current dir';
  40.        17: msg := 'Can''t rename across drives';
  41.  
  42.       100: msg := 'Disk read error';
  43.       101: msg := 'Disk write error';
  44.       102: msg := 'File not assigned';
  45.       103: msg := 'File not open';
  46.       104: msg := 'File not open for input';
  47.       105: msg := 'File not open for output';
  48.       106: msg := 'Bad numeric format';
  49.  
  50.       150: msg := 'Disk is write-protected';
  51.       151: msg := 'Unknown unit';
  52.       152: msg := 'Drive not ready';
  53.       153: msg := 'Unknown command';
  54.       154: msg := 'CRC error in data';
  55.       155: msg := 'Bad drive request structure length';
  56.       156: msg := 'Disk seek error';
  57.       157: msg := 'Unknown media type';
  58.       158: msg := 'Sector not found';
  59.       159: msg := 'Printer out of paper';
  60.       160: msg := 'Device write fault';
  61.       161: msg := 'Device read fault';
  62.       162: msg := 'Hardware failure';
  63.  
  64.       200: msg := 'Division by zero';
  65.       201: msg := 'Range check';
  66.       202: msg := 'Stack overflow';
  67.       203: msg := 'Heap overflow';
  68.       204: msg := 'Bad pointer operation';
  69.       205: msg := 'Floating point overflow';
  70.       206: msg := 'Floating point underflow';
  71.       207: msg := 'Bad floating point operation';
  72.  
  73.       208: msg := 'Overlay Manager not initialized';
  74.  
  75.       else str(code,msg);
  76.    end;
  77.  
  78.    errormsg := class + ': ' + msg;
  79. end;
  80.